package com.example.shop_2207.database

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import com.example.shop_2207.entity.HistoryEntity
//实际业务中存在删除单个历史记录和删除全部历史记录的功能
@Dao
interface HistoryDao {
    //新增历史记录
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insertHis(his:HistoryEntity)

    //查看历史记录
    @Query("select * from history")
    fun queryHis():List<HistoryEntity>
}